<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // match() 匹配
    var str = "good good study , Day day up";

    var arr = str.match("day");
    var arr = str.match("Day");
    // console.log(arr);

    var reg = /day/;
    var arr = str.match(reg);
    // console.log(arr);

    //replace
    var newStr = str.replace("day" , "wctm");
    var reg = /Day/ig;
    var newStr = str.replace(reg , "wctm");
    console.log(newStr);

    //split()
    var str = "a-c-d-g";
    var newstr = str.split("-");
    
    var reg = /-/;
    var newstr = str.split(reg);
    console.log(newstr);
</script>
</html>